
const express = require('express')
const app = express()

const IndexRouter = require('./router2/IndexRouter')

const LoginRouter = require('./router2/LoginRouter')

//应用级别
app.use((req,res,next)=>{
    console.log('验证token');
    next()
})


//应用级别
app.use("/",IndexRouter)
app.use("/login",LoginRouter)


//错误中间件  一定要放到最后
app.use((req,res)=>{
    res.status(404).send('丢了')
})


app.listen(3000,()=>{
    console.log('server start ...');
})